var express = require('express');
var bodyParser = require('body-parser');
var path = require('path');

var app = express();

//使用static文件夹里的文件
//app.use(express.static('static'));
app.use(express.static(path.join(__dirname, 'static')));

//获得username，password和userlevel并且打印出来
app.use(function (req, res){
    var username = req.body.username;
    var password = req.body.password;
    var userlevel = req.body.userlevel;
    console.log(username+'\n');
    console.log(password+'\n');
    console.log(userlevel);
});


app.use(function (req, res){

    res.json({"test": 0});
})

app.listen(4000, function(){console.log("listen 4000");})
